Harden CodexMobile pairing and mobile security#2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2eff7d81cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return codexSandboxForPermissionMode(permissionMode, { | ||
| dangerFullAccessEnabled: process.env.CODEXMOBILE_ENABLE_DANGER_FULL_ACCESS === '1' |
There was a problem hiding this comment.
Honor all enabled values for danger-full-access
When CODEXMOBILE_ENABLE_DANGER_FULL_ACCESS is set to true, yes, or on, readSecurityOptions() enables the feature and the UI/chat service will accept bypassPermissions, but headless local Codex turns still call codexSandboxForPermissionMode() with dangerFullAccessEnabled false because this check only accepts the literal string 1. In those deployments, selecting the now-visible full-access mode is rejected or fails just as the local turn starts; use the same flag parsing as the rest of the server instead of comparing directly to '1'.
Useful? React with 👍 / 👎.
|
已将部分安全策略逻辑融合进了最新版本中,感谢贡献 |
概要
本 PR 对 CodexMobile 的移动端私有访问链路做安全加固,并把已登录设备管理恢复到当前侧边栏设置浮窗中。
主要改动:
http://<LAN/Tailscale IP>:<port>能正常配对和连接 WebSocket,同时继续拒绝恶意 Host/Origin 组合。背景 / 根因
安全加固迁移过程中,项目已经部分从 Bearer/localStorage 认证迁移到 Cookie 可信设备认证,但仍有几条链路不一致:
用户影响
安全说明
HttpOnly、SameSite=Strict、可选Secure、TTL 和 token 轮换。验证
已运行:
## Summary
This PR hardens CodexMobile for private mobile access and restores device management in the current sidebar-based UI.
Key changes:
http://<LAN/Tailscale IP>:<port>can pair and connect WebSocket while hostile Host/Origin combinations remain rejected.Root Cause
The security-hardening migration had partially moved CodexMobile from bearer/localStorage auth to cookie-backed trusted devices, but several UI and protocol paths were still inconsistent:
User Impact
Security Notes
HttpOnly,SameSite=Strict, optionalSecure, TTL, and rotation.Validation
Ran:
Result: